package com.rockxin.cat.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.rockxin.cat.R;
import com.rockxin.cat.bean.CapitalLogBean;
import com.rockxin.cat.utils.MoneyHandlingUtils;

import java.util.List;

/**
 * <b>类名称：    CapitalLogAdapter             <br/>
 * <b>类描述：                        <br/>
 * <b>创建人：    Lans               <br/>
 * <b>创建时间：  2018/3/6 10:31     <br/>
 * <b>修改人：                        <br/>
 * <b>修改时间：                      <br/>
 * <b>修改备注：                      <br/>
 *
 * @version 1.0.0 <br/>
 */
public class CapitalLogAdapter extends BaseQuickAdapter<CapitalLogBean, BaseViewHolder> {
    public CapitalLogAdapter(@Nullable List<CapitalLogBean> data) {
        super(R.layout.fragment_capital_log_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CapitalLogBean item) {
        helper.setText(R.id.logDate, item.getCreate_time())
                .setText(R.id.logMoney, MoneyHandlingUtils.formatDouble(MoneyHandlingUtils.stringFormatDouble(item.getMoney())))
                .setText(R.id.logType, item.getTitle())
                .setText(R.id.logLast, MoneyHandlingUtils.formatDouble(MoneyHandlingUtils.stringFormatDouble(item.getAccount_money())));
    }
}
